<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="common/head :: head"></head>
<body>
<table class="table table-striped table-bordered table-hover dataTables-example">
    <thead>
    <tr>
        <th>序号</th>
        <th>头像</th>
        <th>用户姓名</th>
        <th>用户账号</th>
        <th>手机号</th>
        <th>创建时间</th>
        <th>操作 </th>
    </tr>
    </thead>
    <tbody>
    <tr class="gradeX">
        <td class="text-center">1</td>
        <td>
            <img th:src="${admin.headUrl}" style="width: 60px; height: 60px;">
        </td>
        <td th:text="${admin.name}">22</td>
        <td th:text="${admin.username}">33</td>
        <td th:text="${admin.phone}">22</td>
        <td th:text="${#dates.format(admin.createTime,'yyyy-MM-dd HH:mm:ss')}" >33</td>
        <td class="text-center">
            <a class="edit" th:attr="data-id=${admin.id}">修改</a>
            <a class="upload" th:attr="data-id=${admin.id}">上传头像</a>
            <a class="assign" th:attr="data-id=${admin.id}">分配角色</a>
        </td>
    </tr>
    </tbody>
</table>
<script th:inline="javascript">
    $(function(){
        $(".create").on("click",function () {
            opt.openWin('/admin/create','新增',630,430)
        });
        $(".edit").on("click",function () {
            var id = $(this).attr("data-id");
            opt.openWin('/admin/edit/' + id,'修改',580,430);
        });
        $(".upload").on("click",function(){
            var id = $(this).attr("data-id");
            opt.openWin('/admin/uploadShow/'+id,'上传头像',580,300);
        });
        $(".assign").on("click",function () {
            var id = $(this).attr("data-id");
            opt.openWin('/admin/assignShow/'+id,'分配角色',550,450)
        });
    });
</script>
</body>
</html>